package com.niiwoo.civet.trade.dto.response.guarantee;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 * @author liming
 * @date 2018-01-19 12:01
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class GuaranteeBaseResponseDTO implements Serializable{

    private static final long serialVersionUID = -9170659148856432061L;

    /**
     * 响应状态码(0-失败,1-成功)
     */
    private  Byte code;
    /**
     * 响应状态描述
     */
    private String message;

    public Boolean isSuccess(){
        return Byte.valueOf("1").equals(code);
    }

    public void setSuccess(){
        this.code = (byte)1;
    }

    public void setFailure(){
        this.code = (byte)0;
    }

}
